/**
 * @Author：ming
 * @Date：2023/10/29 10:45 PM
 * @Filename：Hot94
 */

import java.util.ArrayList;
import java.util.List;

/**
 * @author ming
 */
public class Hot94 {
    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> list = new ArrayList<>();
        inorder(root,list);

        return list;
    }

    public static List<Integer> inorder(TreeNode root,List<Integer> list){
        if(root==null){
            return list;
        }

        inorder(root.left,list);
        list.add(root.val);
        inorder(root.right,list);

        return list;
    }
}
